<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Indefinite Appearance</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Indefinite Appearance' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">knowledge</a></li><li><a href="index.html#5">Chapter 5: Modelling</a></li><li><b>Indefinite Appearance</b></li></ul></div>
<p class="purpose">When the source text comments on something with a sentence consisting only of a double-quoted literal text, we infer that as an indefinite appearance property.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>For instance:
</p>

<blockquote>
    <p>The drapery is in the Crypt. "The drapery hangs, poignantly waiting to fall."</p>
</blockquote>

<p class="commentary">This text will probably become a property of the drapery, but which property
depends on the drapery's kind. That means we can't decide until after the
source text is fully read, because we won't be certain of kinds until then.
So as an interim measure the text is inferred into a pseudo-property called
"indefinite appearance".
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Properties::Appearance::infer</span><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">KNOWLEDGE_LOOP</span><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">, </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">property_inf</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="5-pi.html#SP8" class="function-link"><span class="function-syntax">PropertyInferences::get_property</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">) == </span><span class="identifier-syntax">P_indefinite_appearance_text</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="5-ia.html#SP1_1" class="named-paragraph-link"><span class="named-paragraph">Issue a problem for a second appearance</span><span class="named-paragraph-number">1.1</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="4-ks.html#SP3" class="function-link"><span class="function-syntax">KindSubjects::to_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><a href="4-is.html#SP10" class="function-link"><span class="function-syntax">InferenceSubjects::is_within</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><a href="4-ks.html#SP3" class="function-link"><span class="function-syntax">KindSubjects::from_kind</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K_object</span><span class="plain-syntax">))))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax"> = </span><span class="identifier-syntax">LIKELY_CE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-vp.html#SP9" class="function-link"><span class="function-syntax">ValueProperties::assert</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P_indefinite_appearance_text</span><span class="plain-syntax">, </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">spec</span><span class="plain-syntax">, </span><span class="identifier-syntax">prevailing_mood</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP1_1" class="paragraph-anchor"></a><b>&#167;1.1. </b>...but we produce a firm and explicit problem message if somebody sets it
ambiguously.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Issue a problem for a second appearance</span><span class="named-paragraph-number">1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::infs_contradiction_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_TwoAppearances</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">), </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">, </span><span class="identifier-syntax">infs</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"seems to have two different descriptions"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="string-syntax">"perhaps because you intended the second description to apply to something "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"mentioned in between, but declared it in such a way that it was never the "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"subject of an assertion. For instance, 'The Forest Clearing is northeast of "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"the Woods.' makes the Forest Clearing the current room being discussed, but "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"'Northeast of the Woods is the Forest Clearing.' leaves the room under "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"discussion unchanged, because the Forest Clearing is not the subject of "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"the sentence."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-ia.html#SP1">&#167;1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>During stage II of world model completion, we will have to make those decisions
about what property the indefinite appearance text should go into. This is
called "reallocation", and as can be seen the method is:
</p>

<ul class="items"><li>(a) See if any plugin wants to take action;
</li><li>(b) Otherwise reallocate to the "description" property, if available;
</li><li>(c) Otherwise give up and issue a problem message.
</li></ul>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Properties::Appearance::reallocate</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Properties::Appearance::reallocate</span></span>:<br/>The Model World - <a href="5-tmw.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inference_subject</span><span class="plain-syntax"> *</span><span class="identifier-syntax">infs</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inference</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inf</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">KNOWLEDGE_LOOP</span><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">, </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">property_inf</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="5-pi.html#SP8" class="function-link"><span class="function-syntax">PropertyInferences::get_property</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">) == </span><span class="identifier-syntax">P_indefinite_appearance_text</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">txt</span><span class="plain-syntax"> = </span><a href="5-pi.html#SP8" class="function-link"><span class="function-syntax">PropertyInferences::get_value</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax"> = </span><a href="5-inf.html#SP3" class="function-link"><span class="function-syntax">Inferences::where_inferred</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inf</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">PluginCalls::default_appearance</span><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">txt</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">P_description</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">                    (</span><a href="4-pp.html#SP2" class="function-link"><span class="function-syntax">PropertyPermissions::find</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">P_description</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">                    </span><a href="3-vp.html#SP9" class="function-link"><span class="function-syntax">ValueProperties::assert</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P_description</span><span class="plain-syntax">, </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">txt</span><span class="plain-syntax">, </span><span class="identifier-syntax">CERTAIN_CE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">StandardProblems::inference_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_IndefiniteTextMeaningless</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">infs</span><span class="plain-syntax">, </span><span class="identifier-syntax">inf</span><span class="plain-syntax">, </span><span class="string-syntax">"is not allowed"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"i.e., you can't write a double-quoted piece of text as a "</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"sentence all by itself here. Some kinds or kinds of value "</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"are allowed this - objects and scenes, for instance - but "</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"most are not. (They would need to provide a 'description' "</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"property.)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="5-pi.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-km.html">1</a></li><li class="progresschapter"><a href="2-ins.html">2</a></li><li class="progresschapter"><a href="3-prp.html">3</a></li><li class="progresschapter"><a href="4-is.html">4</a></li><li class="progresscurrentchapter">5</li><li class="progresssection"><a href="5-inf.html">inf</a></li><li class="progresssection"><a href="5-pi.html">pi</a></li><li class="progresscurrent">ia</li><li class="progresssection"><a href="5-ri.html">ri</a></li><li class="progresssection"><a href="5-tmw.html">tmw</a></li><li class="progresssection"><a href="5-tnt.html">tnt</a></li><li class="progressnext"><a href="5-ri.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

